OLE.AddLicense Function

Syntax

Result_Flag as L = OLE.AddLicence( ProgID as C, License_Key as C )

Arguments

Result_Flag

Returns TRUE if there is not already a ProgID with a License_Key associated with it.

ProgID

The software's programmatic identifier. See OLE Automation Object Browser.

License_Key

A key provided by the licensor of the software.

Description

Adds a ProgID and associated license key to the global license cache.

Discussion

The OLE.AddLicence() method adds a programmatic identifier and associated license key to the global license cache. Licensed controls generally work as follows:

1. The developer acquires a control and the license to develop with it.
2. The developer deploys the application with an embedded reference to the license key (as in forms) or an explicit license key (as in XDialog).
In the case of desktop forms, Alpha Anywhere automatically generates the license key registration when the developer saves the form. The user does not have to do anything to make this work.
In the case of XDialog forms, the Code Editor contains a right-click menu item to paste syntax into the script on a line prior to the creation of the XDialog (and the control). An example of the pasted script:
ole.AddLicense("MyCompany.MyProgId", "licxxxxxxkeyvalue")

Example

? ole.addlicense("a", "lic1")
= .T.
? ole.getlicense("a")
= "lic1"
? ole.loaddeveloperlicense("b")
ERROR: OLE: No license found for 'b'
? ole.removelicense("a")
= .T.
? ole.getlicense("a")
ERROR: OLE: No license found for 'a'

See Also